import http from '@/utils/request';

// 获取合同
// export function notarizationWaitShow(id) {
//   return http.get({
//     url: `v2/orders/${id}/notarization/wait`,
//   });
// }

// 获取公证合同
export function notarizationWaitShow(id, redirect) {
  return http.get({
    url: `v2/orders/${id}/notarization/wait?redirect=${redirect}`,
  });
}

// 获取公证合同结果
export function queryNotaryStatus(code) {
  return http.get({
    url: 'v2/notary/' + code + '/status'
  });
}

// 上传电子签名
export function notarizationSign(data,id) {
  const filePath = data.file;
  delete data.file
  return http.file({
	url: `v2/orders/${id}/notarization/image`,
    filePath,
    name: 'image',
	formData: data
  });
}

// 人脸识别
export function notarizationFace(type = 'h5', id) {
  return http.get({
    url: `v2/orders/${id}/notarization/face/${type}`,
  });
}

// 公证人脸识别完成
export function notarizationCompleted(data) {
  return http.post({
    url: `v2/orders/notarization/face/completed`,
	data
  });
}

// // 获取合同手签手签
// export function contractShow(id) {
//   return http.get({
//     url: `v2/orders/${id}/contract/wait`,
//   });
// }

// 获取合同手签手签
export function contractShow(id, redirect) {
  return http.get({
    url: `v2/orders/${id}/contract/wait?redirect=${redirect}`,
  });
}

// 获取签订合同结果
export function querySignStatus(code) {
  return http.get({
    url: 'v2/sign/' + code + '/status'
  });
}

// 上传电子签名手签
export function uploadSign(data,id) {
  const filePath = data.file;
  delete data.file
  return http.file({
	url: `v2/orders/${id}/sign/image`,
    filePath,
    name: 'image',
	formData: data
  });
}

// 上传电子签名手签demo
export function uploadSignDemo(data) {
  const filePath = data.file;
  delete data.file
  return http.file({
	url: `v1/handsign/demo`,
    filePath,
    name: 'image',
	formData: data
  });
}

// 人脸识别手签
export function signFace(type = 'h5', id) {
  return http.get({
    url: `v2/orders/${id}/sign/face/${type}`,
  });
}

// 人脸识别完成手签
export function signCompleted(data) {
  return http.post({
    url: `v2/orders/sign/face/completed`,
	data
  });
}

// 人脸识别
export function cloudFace(type = 'h5') {
  return http.get({
    url: `v1/identification/cloud/face/${type}`,
  });
} 
// 认证人脸识别完成
export function faceStatus(data) {
  return http.get({
    url: `v1/identification/cloud/face/status`,
	data
  });
}

